package com.htd.erp.product;

import java.io.Serializable;

import javax.enterprise.context.ConversationScoped;
import javax.enterprise.event.Event;
import javax.inject.Inject;
import javax.inject.Named;

import com.htd.erp.common.EntityHome;
import com.htd.erp.model.Classification;

/**
 * @author Zhang Guilin
 *
 */
@Named
@ConversationScoped
public class ClassificationHome extends EntityHome<Classification> implements Serializable {
	
	private static final long serialVersionUID = -3433190706860971768L;
	
	@Inject
	private Event<ClassificationCreatedEvent> events;
	
	@Override
	public void save() {
		super.save();
		events.fire(new ClassificationCreatedEvent(getEntity()));
	}
	
	@Override
	protected Classification newEntityInstance() {
		return new Classification();
	}

	@Override
	protected Class<Classification> getEntityClass() {
		return Classification.class;
	}
}
